package com.yt.ootest.StratePattern;

import com.yt.ootest.StratePattern.Behavior.Fly.FlyBehavior;
import com.yt.ootest.StratePattern.Behavior.Quack.QuackBehavior;

/**
 * Created by Administrator on 2019/1/27 18:19
 */
public abstract class Duck {

    FlyBehavior mFlyBehavior;
    QuackBehavior mQuackBehavior;
    public Duck() {
    }

    public abstract void display();

    public void Quack() {
        mQuackBehavior.Quack();
    }


    public void Fly() {
        mFlyBehavior.Fly();
    }

    public void setmFlyBehavior(FlyBehavior mFlyBehavior) {
        this.mFlyBehavior = mFlyBehavior;
    }

    public void setmQuackBehavior(QuackBehavior mQuackBehavior) {
        this.mQuackBehavior = mQuackBehavior;
    }


}
